import {COMPONENT_TYPE} from '../../../../../libs/constants'

export default [
  {
    id:'1',
    type: COMPONENT_TYPE.RADIO_BUTTON,
    formItem: {
      prop: 'align',
      rules: [],
      label: '对齐方式',
      extra: '设置列内容的对齐方式',
    },
    attrs: {
      value: 'left',
      buttonStyle: 'solid',
      children: [
        {
          value: 'left',
          label: 'left'
        },
        {
          value: 'right',
          label: 'right'
        },
        {
          value: 'center',
          label: 'center'
        }
      ]
    }
  },
  {
    id:'2',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      prop: 'dataIndex',
      rules: [
        {required: true, message: '请输入列编码', trigger: 'blur'},
        {min: 2, message: '列编码最小长度为2个字符', trigger: 'blur'}
      ],
      label: '列编码',
      extra: '列数据在数据项中对应的 key，支持 a.b.c 的嵌套写法',
    },
    attrs: {
      value: 'key_' + Date.now(),
      type: 'text',
      allowClear: true,
      placeholder: '请输入列编码'
    }
  },
  {
    id:'3',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      prop: 'title',
      rules: [
        {required: true, message: '请输入列标题', trigger: 'blur'},
        {min: 2, message: '列标题最小长度为2个字符', trigger: 'blur'}
      ],
      label: '列标题',
      extra: '列头显示文字',
    },
    attrs: {
      value: 'key_' + Date.now(),
      type: 'text',
      allowClear: true,
      placeholder: '请输入列标题'
    }
  },
  {
    id:'4',
    type: COMPONENT_TYPE.SLIDER,
    formItem: {
      prop: 'width',
      extra: '列宽度',
      rules: [],
      label: '列宽度',
    },
    attrs: {
      hasInput: true,
      value: 100,
      min: 1,
      max: 999
    }
  },
  {
    id:'5',
    type: COMPONENT_TYPE.RADIO_BUTTON,
    formItem: {
      prop: 'fixed',
      rules: [],
      label: '固定',
      extra: '列是否固定，可选 true(等效于 left) - | left | right',
    },
    attrs: {
      value: 'false',
      buttonStyle: 'solid',
      children: [
        {
          value: false,
          label: '-'
        },
        {
          value: 'left',
          label: 'left'
        },
        {
          value: 'right',
          label: 'right'
        }
      ]
    }
  },
  {
    id:'6',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      prop: 'value',
      rules: [
        {required: true, message: '请输入模拟数据', trigger: 'blur'},
        {min: 3, message: '模拟数据最小长度为1个字符', trigger: 'blur'}
      ],
      label: '模拟数据',
      extra: '展示在表格中的模拟数据',
    },
    attrs: {
      value: 'key_' + Date.now(),
      type: 'text',
      allowClear: true,
      placeholder: '请输入模拟数据'
    }
  }
]

